package com.sikadwafastdaisfondturbo.pretloan.adapter

import androidx.recyclerview.widget.RecyclerView
import com.sikadwafastdaisfondturbo.lib_baseadapter.SikadwaRecyclerViewAdapter
import com.sikadwafastdaisfondturbo.lib_baseadapter.SikadwaViewHolderHelper
import com.sikadwafastdaisfondturbo.pretloan.R
import com.sikadwafastdaisfondturbo.pretloan.utils.gilde.ImageUtil
import org.json.JSONObject

/**
 * Sikadwa
 * @Author wwdeng
 * @CreateTime: 2024/4/19 12:02
 * @Annotation：贷款已绑定账户适配器
 */
class CreditAccountAdapter(recyclerView: RecyclerView?): SikadwaRecyclerViewAdapter<JSONObject>(recyclerView,R.layout.item_credit_account) {

    override fun setItemChildListener(helper: SikadwaViewHolderHelper, viewType: Int) {
    }

    override fun fillData(helper: SikadwaViewHolderHelper, position: Int, model: JSONObject) {
        helper.setText(R.id.textName,model.optString("name"))
        helper.setText(R.id.textMobile,model.optString("account"))

        val imgLogo = helper.getImageView(R.id.imgLogo)
        ImageUtil.instance!!.loadImageUrl(mContext,imgLogo,model.optString("logo"),R.mipmap.img_holder)
    }
}